# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: googol <googol@posteo.de>
# Contributor: Oliver Mangold <o.mangold at gmail dot com>

pkgname=python-alembic
pkgver=1.9.4
pkgrel=2
pkgdesc='Lightweight database migration tool for usage with SQLAlchemy'
url='https://github.com/sqlalchemy/alembic'
arch=('any')
license=('MIT')
depends=('python' 'python-mako' 'python-sqlalchemy' 'python-editor'
         'python-dateutil' 'python-importlib-metadata')
makedepends=('python-setuptools' 'python-mako' 'python-sqlalchemy' 'python-editor' 'python-dateutil')
checkdepends=('python-pytest')
source=(https://pypi.org/packages/source/a/alembic/alembic-${pkgver}.tar.gz{,.asc})
sha512sums=('76e6f86e789cecff78f8e86c34d22a70615158833bc24a26f38fe2d0d5ccd098920e0fe4cbebaadd2c9a4a2e63152720945645000d46a2b6b8b6696ce873f899'
            'SKIP')
b2sums=('5b740803b6bf5b715e9572a91d87d5403d64e665647776d28511704fa17ed81825fe6f5cdab2cec77a0806abb02ef2a7acf5f9702ff87639b90e74d9e22a4b1a'
        'SKIP')
validpgpkeys=('83AF7ACE251C13E6BB7DEFBD330239C1C4DAFEE1') # Michael Bayer <classic@zzzcomputing.com>

prepare() {
  cd alembic-${pkgver}
  # do not treat warnings as errors
  sed 's|-p no:warnings||g' -i setup.cfg
}

build() {
  cd alembic-${pkgver}
  python setup.py build
}

check() {
  cd alembic-${pkgver}
  py.test
}

package() {
  cd alembic-${pkgver}
  python setup.py install --root="${pkgdir}" --prefix=/usr -O1 --skip-build
  install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
  install -Dm 644 README.rst CHANGES -t "${pkgdir}/usr/share/doc/${pkgname}"
}

# vim: ts=2 sw=2 et:
